﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cms.BLL.Controls
{
    public class BoxOption
    {
        /// <summary>
        /// 获取数据所需SQL
        /// </summary>
        public string Sql { get; set; }
        /// <summary>
        /// 值字段
        /// </summary>
        public string ValueField { get; set; }
        /// <summary>
        /// 文本字段
        /// </summary>
        public string TextField { get; set; }
        /// <summary>
        /// 是否可以直接编辑
        /// </summary>
        public bool Editable { get; set; }
        public BoxOption() {
            this.Sql = "";
            this.ValueField = "";
            this.TextField = "";
            this.Editable = false;            
        }
    }
    public class Combobox : BaseControl
    {
        /// <summary>
        /// 默认选中值
        /// </summary>
        public string SelectItem { get; set; }
        /// <summary>
        /// 内容列表
        /// </summary>
        public string Options { get; set; }
        public BoxOption BoxOption { get; set; }
        public Combobox()
        {
            this.Type = ControlType.Combobox;
            this.Style.Height = 16;
            this.Style.Width = 147;
            this.BoxOption = new BoxOption();
            this.SelectItem = "";
        }
    }
}
